<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:f="http://xmlns.jcp.org/jsf/core">

<h:head>
    <title>Registration</title>
</h:head>
<h:body>
	<p:panel header="Registration">
	<h:form id="login">
		<h:panelGrid columns="3">
			<p:outputLabel value = "Username:"/>
			<p:inputText id="username" value="#{RegistrationManaged.reDTO.idUser}"/>
			<p:message for="username" />
			
			<p:outputLabel value="Password:"/>
	        <p:password id="password" value="#{RegistrationManaged.reDTO.password}"
	                         feedback="true" match="confirmPassword" label="Password"/>
	        <p:message for="password"/>
	        <p:outputLabel value="Confirm password:"/>
	        <p:password id="confirmPassword" label="Confirm password"
	                        value="#{RegistrationManaged.reDTO.password}"/>
	        <p:message for="confirmPassword" />
	                        
			<p:outputLabel value = "Phone Number:"/>
			<p:inputText id="phone" value="#{RegistrationManaged.reDTO.phone}"/>
			<p:message for="phone" />
			
			<p:outputLabel value = "Address:"/>
			<p:inputText id="address" value="#{RegistrationManaged.reDTO.address}"/>
			<p:message for="address" />
			
			<p:outputLabel value = "Name:"/>
			<p:inputText id="name" value="#{RegistrationManaged.reDTO.name}"/>
			<p:message for="name" />
			
			<p:outputLabel value = "Surname:"/>
			<p:inputText id="surname" value="#{RegistrationManaged.reDTO.surName}"/>
			<p:message for="surname" />
		</h:panelGrid>
		<p:commandButton value="Register" action="#{RegistrationManaged.register}" ajax="false" />
	</h:form>
	</p:panel>
	<p:messages id="messages" showDetail="true" autoUpdate="true" closable="true" />
</h:body>
</html>